package com.zhenhao.xsq.ui.activity.camera.module;


import com.zhenhao.xsq.data.api.HttpAPIWrapper;
import com.zhenhao.xsq.ui.activity.base.ActivityScope;
import com.zhenhao.xsq.ui.activity.camera.CameraListActivity;
import com.zhenhao.xsq.ui.activity.camera.contract.CameraListContract;
import com.zhenhao.xsq.ui.activity.camera.presenter.CameraListPresenter;

import dagger.Module;
import dagger.Provides;

/**
 * @author xlei
 * @Package com.yxld.gb.xsq.ui.activity.camera
 * @Description: The moduele of CameraListActivity, provide field for CameraListActivity
 * @date 2019/04/28 14:45:31
 */
@Module
public class CameraListModule {
    private final CameraListContract.View mView;


    public CameraListModule(CameraListContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public CameraListPresenter provideCameraListPresenter(HttpAPIWrapper httpAPIWrapper, CameraListActivity mActivity) {
        return new CameraListPresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public CameraListActivity provideCameraListActivity() {
        return (CameraListActivity) mView;
    }
}